function checkLogin(){
    $.ajax({
        url: 'http://101.200.41.77:8080/login/checkLogin',
        method: 'POST',
        crossDomain: true,
        xhrFields: { withCredentials: true },
        success: function (msg) {
            console.log(msg)
            if(msg.code === -1 || msg.data.user.base.user_group_id === 1){
                window.location.href='../../pages/index.html'
            }
            let info = msg.data.user;
            //用户没有登录
            if(info == null){
                return;
            }
            //    登录了
            window.user = info;
            console.log(info)
            if(info.base.userGroup !== 1){
                return;
            }
            // setNavUserInfo(info);
            //    切换用户头像与登录按钮
        }, error: function (error) {
            console.log(123)
        }
    });
}

function init(){
    checkLogin();
}